package com.design.observer;

/**
* Description: 观察者模式<br/>
* date: 2023/11/24 17:10<br/>
* @author: zhangzaijun <br/>
* @since JDK 1.8
*/

public class ObserverMain {
    public static void main(String[] args) {
        Subject subject = new Subject();

        new BinaryObserver(subject);
        new HexaObserver(subject);
        new OctalObserver(subject);

        System.out.println("First state change: 20");
        subject.setState(20);
        System.out.println("Second state change: 10");
        subject.setState(10);
    }
}
